package com.overseasShopping.Base.DAOImpl;

import java.util.List;

import com.overseasShopping.Base.DAO.InformationDAO;
import com.overseasShopping.pojo.Information;
import com.overseasShopping.pojo.User;

public class InformationDAOImpl extends BaseDAOImpl<Information> implements InformationDAO{

	public List<Information> getsendinfobyuid(User user) {
		String hql="from Information where infostatu != 'del' or infostatu is null and sendUser=?";
		Object[] params={user};
		List<Information> Informationlist=getHibernateTemplate().find(hql,params);
		return Informationlist!=null && Informationlist.size()>0 ? Informationlist:null;
	}

	public List<Information> getreceiveinfobyuid(User user) {
		String hql="from Information where infostatu != 'del' or infostatu is null and receiveUser=?";
		Object[] params={user};
		@SuppressWarnings("unchecked")
		List<Information> Informationlist=getHibernateTemplate().find(hql,params);
		return Informationlist!=null && Informationlist.size()>0 ? Informationlist:null;
	}

}
